local anguo = fk.CreateSkill {

  name = "joy__anguo",

  tags = {  },

}



anguo:addEffect("active", {
  name = "joy__anguo",
  anim_type = "support",
  prompt = "#anguo-active",
  card_num = 0,
  target_num = 1,
  can_use = function(self, player)
    return player:usedSkillTimes(anguo.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  target_filter = function(self, player, to_select, selected)
    return #selected == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local target = effect.tos[1]
    local types = {"equip", "recover", "draw"}
    for i = 3, 1, -1 do
      if doAnguo(target, types[i], player) then
        table.removeOne(types, types[i])
        if target.dead then
          break
        end
      end
    end
    for i = #types, 1, -1 do
      if player.dead then break end
      doAnguo(player, types[i], player)
    end
  end,
})

return anguo